package net.rock.eshop.mapper;

import net.rock.eshop.entity.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BookMapper {
    Book fetchBookById(int id);

    List<Book> fetchBooks(
            @Param("categoryId") Integer categoryId,
            @Param("offset") Integer offset);

    void add(Book book);
    void del(int id);
    void edit(Book book);
    List<Book> searchBooks(String keyword);
}
